<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - mbi.info - /usr/include/c++/4.4.1/bits/stl_uninitialized.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../../index.html">directory</a> - <a href="index.html">usr/include/c++/4.4.1/bits</a> - stl_uninitialized.h</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>mbi.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-01-23</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">23</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">87.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">20</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // Raw memory manipulators -*- C++ -*-
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
<span class="lineNum">       4 </span>                : // Free Software Foundation, Inc.
<span class="lineNum">       5 </span>                : //
<span class="lineNum">       6 </span>                : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       7 </span>                : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       8 </span>                : // terms of the GNU General Public License as published by the
<span class="lineNum">       9 </span>                : // Free Software Foundation; either version 3, or (at your option)
<span class="lineNum">      10 </span>                : // any later version.
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span>                : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      13 </span>                : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      14 </span>                : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      15 </span>                : // GNU General Public License for more details.
<span class="lineNum">      16 </span>                : 
<span class="lineNum">      17 </span>                : // Under Section 7 of GPL version 3, you are granted additional
<span class="lineNum">      18 </span>                : // permissions described in the GCC Runtime Library Exception, version
<span class="lineNum">      19 </span>                : // 3.1, as published by the Free Software Foundation.
<span class="lineNum">      20 </span>                : 
<span class="lineNum">      21 </span>                : // You should have received a copy of the GNU General Public License and
<span class="lineNum">      22 </span>                : // a copy of the GCC Runtime Library Exception along with this program;
<span class="lineNum">      23 </span>                : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
<span class="lineNum">      24 </span>                : // &lt;http://www.gnu.org/licenses/&gt;.
<span class="lineNum">      25 </span>                : 
<span class="lineNum">      26 </span>                : /*
<span class="lineNum">      27 </span>                :  *
<span class="lineNum">      28 </span>                :  * Copyright (c) 1994
<span class="lineNum">      29 </span>                :  * Hewlett-Packard Company
<span class="lineNum">      30 </span>                :  *
<span class="lineNum">      31 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      32 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      33 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      34 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      35 </span>                :  * in supporting documentation.  Hewlett-Packard Company makes no
<span class="lineNum">      36 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      37 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      38 </span>                :  *
<span class="lineNum">      39 </span>                :  *
<span class="lineNum">      40 </span>                :  * Copyright (c) 1996,1997
<span class="lineNum">      41 </span>                :  * Silicon Graphics Computer Systems, Inc.
<span class="lineNum">      42 </span>                :  *
<span class="lineNum">      43 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      44 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      45 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      46 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      47 </span>                :  * in supporting documentation.  Silicon Graphics makes no
<span class="lineNum">      48 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      49 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      50 </span>                :  */
<span class="lineNum">      51 </span>                : 
<span class="lineNum">      52 </span>                : /** @file stl_uninitialized.h
<span class="lineNum">      53 </span>                :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      54 </span>                :  *  You should not attempt to use it directly.
<span class="lineNum">      55 </span>                :  */
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                : #ifndef _STL_UNINITIALIZED_H
<span class="lineNum">      58 </span>                : #define _STL_UNINITIALIZED_H 1
<span class="lineNum">      59 </span>                : 
<span class="lineNum">      60 </span>                : _GLIBCXX_BEGIN_NAMESPACE(std)
<span class="lineNum">      61 </span>                : 
<span class="lineNum">      62 </span>                :   template&lt;bool&gt;
<span class="lineNum">      63 </span>                :     struct __uninitialized_copy
<span class="lineNum">      64 </span>                :     {
<span class="lineNum">      65 </span>                :       template&lt;typename _InputIterator, typename _ForwardIterator&gt;
<span class="lineNum">      66 </span>                :         static _ForwardIterator
<span class="lineNum">      67 </span><span class="lineCov">            108 :         uninitialized_copy(_InputIterator __first, _InputIterator __last,</span>
<span class="lineNum">      68 </span>                :                            _ForwardIterator __result)
<span class="lineNum">      69 </span>                :         {
<span class="lineNum">      70 </span><span class="lineCov">            108 :           _ForwardIterator __cur = __result;</span>
<span class="lineNum">      71 </span>                :           __try
<span class="lineNum">      72 </span>                :             {
<span class="lineNum">      73 </span><span class="lineCov">            238 :               for (; __first != __last; ++__first, ++__cur)</span>
<span class="lineNum">      74 </span><span class="lineCov">            130 :                 ::new(static_cast&lt;void*&gt;(&amp;*__cur)) typename</span>
<span class="lineNum">      75 </span>                :                     iterator_traits&lt;_ForwardIterator&gt;::value_type(*__first);
<span class="lineNum">      76 </span><span class="lineCov">            108 :               return __cur;</span>
<span class="lineNum">      77 </span>                :             }
<span class="lineNum">      78 </span><span class="lineNoCov">              0 :           __catch(...)</span>
<span class="lineNum">      79 </span>                :             {
<span class="lineNum">      80 </span><span class="lineNoCov">              0 :               std::_Destroy(__result, __cur);</span>
<span class="lineNum">      81 </span><span class="lineNoCov">              0 :               __throw_exception_again;</span>
<span class="lineNum">      82 </span>                :             }
<span class="lineNum">      83 </span>                :         }
<span class="lineNum">      84 </span>                :     };
<span class="lineNum">      85 </span>                : 
<span class="lineNum">      86 </span>                :   template&lt;&gt;
<span class="lineNum">      87 </span>                :     struct __uninitialized_copy&lt;true&gt;
<span class="lineNum">      88 </span>                :     {
<span class="lineNum">      89 </span>                :       template&lt;typename _InputIterator, typename _ForwardIterator&gt;
<span class="lineNum">      90 </span>                :         static _ForwardIterator
<span class="lineNum">      91 </span><span class="lineCov">            125 :         uninitialized_copy(_InputIterator __first, _InputIterator __last,</span>
<span class="lineNum">      92 </span>                :                            _ForwardIterator __result)
<span class="lineNum">      93 </span><span class="lineCov">            125 :         { return std::copy(__first, __last, __result); }</span>
<span class="lineNum">      94 </span>                :     };
<span class="lineNum">      95 </span>                : 
<span class="lineNum">      96 </span>                :   /**
<span class="lineNum">      97 </span>                :    *  @brief Copies the range [first,last) into result.
<span class="lineNum">      98 </span>                :    *  @param  first  An input iterator.
<span class="lineNum">      99 </span>                :    *  @param  last   An input iterator.
<span class="lineNum">     100 </span>                :    *  @param  result An output iterator.
<span class="lineNum">     101 </span>                :    *  @return   result + (first - last)
<span class="lineNum">     102 </span>                :    *
<span class="lineNum">     103 </span>                :    *  Like copy(), but does not require an initialized output range.
<span class="lineNum">     104 </span>                :   */
<span class="lineNum">     105 </span>                :   template&lt;typename _InputIterator, typename _ForwardIterator&gt;
<span class="lineNum">     106 </span>                :     inline _ForwardIterator
<span class="lineNum">     107 </span><span class="lineCov">            233 :     uninitialized_copy(_InputIterator __first, _InputIterator __last,</span>
<span class="lineNum">     108 </span>                :                        _ForwardIterator __result)
<span class="lineNum">     109 </span>                :     {
<span class="lineNum">     110 </span>                :       typedef typename iterator_traits&lt;_InputIterator&gt;::value_type
<span class="lineNum">     111 </span>                :         _ValueType1;
<span class="lineNum">     112 </span>                :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::value_type
<span class="lineNum">     113 </span>                :         _ValueType2;
<span class="lineNum">     114 </span>                : 
<span class="lineNum">     115 </span>                :       return std::__uninitialized_copy&lt;(__is_pod(_ValueType1)
<span class="lineNum">     116 </span>                :                                         &amp;&amp; __is_pod(_ValueType2))&gt;::
<span class="lineNum">     117 </span><span class="lineCov">            233 :         uninitialized_copy(__first, __last, __result);</span>
<span class="lineNum">     118 </span>                :     }
<span class="lineNum">     119 </span>                : 
<span class="lineNum">     120 </span>                : 
<span class="lineNum">     121 </span>                :   template&lt;bool&gt;
<span class="lineNum">     122 </span>                :     struct __uninitialized_fill
<span class="lineNum">     123 </span>                :     {
<span class="lineNum">     124 </span>                :       template&lt;typename _ForwardIterator, typename _Tp&gt;
<span class="lineNum">     125 </span>                :         static void
<span class="lineNum">     126 </span>                :         uninitialized_fill(_ForwardIterator __first,
<span class="lineNum">     127 </span>                :                            _ForwardIterator __last, const _Tp&amp; __x)
<span class="lineNum">     128 </span>                :         {
<span class="lineNum">     129 </span>                :           _ForwardIterator __cur = __first;
<span class="lineNum">     130 </span>                :           __try
<span class="lineNum">     131 </span>                :             {
<span class="lineNum">     132 </span>                :               for (; __cur != __last; ++__cur)
<span class="lineNum">     133 </span>                :                 std::_Construct(&amp;*__cur, __x);
<span class="lineNum">     134 </span>                :             }
<span class="lineNum">     135 </span>                :           __catch(...)
<span class="lineNum">     136 </span>                :             {
<span class="lineNum">     137 </span>                :               std::_Destroy(__first, __cur);
<span class="lineNum">     138 </span>                :               __throw_exception_again;
<span class="lineNum">     139 </span>                :             }
<span class="lineNum">     140 </span>                :         }
<span class="lineNum">     141 </span>                :     };
<span class="lineNum">     142 </span>                : 
<span class="lineNum">     143 </span>                :   template&lt;&gt;
<span class="lineNum">     144 </span>                :     struct __uninitialized_fill&lt;true&gt;
<span class="lineNum">     145 </span>                :     {
<span class="lineNum">     146 </span>                :       template&lt;typename _ForwardIterator, typename _Tp&gt;
<span class="lineNum">     147 </span>                :         static void
<span class="lineNum">     148 </span>                :         uninitialized_fill(_ForwardIterator __first,
<span class="lineNum">     149 </span>                :                            _ForwardIterator __last, const _Tp&amp; __x)
<span class="lineNum">     150 </span>                :         { std::fill(__first, __last, __x); }
<span class="lineNum">     151 </span>                :     };
<span class="lineNum">     152 </span>                : 
<span class="lineNum">     153 </span>                :   /**
<span class="lineNum">     154 </span>                :    *  @brief Copies the value x into the range [first,last).
<span class="lineNum">     155 </span>                :    *  @param  first  An input iterator.
<span class="lineNum">     156 </span>                :    *  @param  last   An input iterator.
<span class="lineNum">     157 </span>                :    *  @param  x      The source value.
<span class="lineNum">     158 </span>                :    *  @return   Nothing.
<span class="lineNum">     159 </span>                :    *
<span class="lineNum">     160 </span>                :    *  Like fill(), but does not require an initialized output range.
<span class="lineNum">     161 </span>                :   */
<span class="lineNum">     162 </span>                :   template&lt;typename _ForwardIterator, typename _Tp&gt;
<span class="lineNum">     163 </span>                :     inline void
<span class="lineNum">     164 </span>                :     uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">     165 </span>                :                        const _Tp&amp; __x)
<span class="lineNum">     166 </span>                :     {
<span class="lineNum">     167 </span>                :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::value_type
<span class="lineNum">     168 </span>                :         _ValueType;
<span class="lineNum">     169 </span>                : 
<span class="lineNum">     170 </span>                :       std::__uninitialized_fill&lt;__is_pod(_ValueType)&gt;::
<span class="lineNum">     171 </span>                :         uninitialized_fill(__first, __last, __x);
<span class="lineNum">     172 </span>                :     }
<span class="lineNum">     173 </span>                : 
<span class="lineNum">     174 </span>                : 
<span class="lineNum">     175 </span>                :   template&lt;bool&gt;
<span class="lineNum">     176 </span>                :     struct __uninitialized_fill_n
<span class="lineNum">     177 </span>                :     {
<span class="lineNum">     178 </span>                :       template&lt;typename _ForwardIterator, typename _Size, typename _Tp&gt;
<span class="lineNum">     179 </span>                :         static void
<span class="lineNum">     180 </span>                :         uninitialized_fill_n(_ForwardIterator __first, _Size __n,
<span class="lineNum">     181 </span>                :                              const _Tp&amp; __x)
<span class="lineNum">     182 </span>                :         {
<span class="lineNum">     183 </span>                :           _ForwardIterator __cur = __first;
<span class="lineNum">     184 </span>                :           __try
<span class="lineNum">     185 </span>                :             {
<span class="lineNum">     186 </span>                :               for (; __n &gt; 0; --__n, ++__cur)
<span class="lineNum">     187 </span>                :                 std::_Construct(&amp;*__cur, __x);
<span class="lineNum">     188 </span>                :             }
<span class="lineNum">     189 </span>                :           __catch(...)
<span class="lineNum">     190 </span>                :             {
<span class="lineNum">     191 </span>                :               std::_Destroy(__first, __cur);
<span class="lineNum">     192 </span>                :               __throw_exception_again;
<span class="lineNum">     193 </span>                :             }
<span class="lineNum">     194 </span>                :         }
<span class="lineNum">     195 </span>                :     };
<span class="lineNum">     196 </span>                : 
<span class="lineNum">     197 </span>                :   template&lt;&gt;
<span class="lineNum">     198 </span>                :     struct __uninitialized_fill_n&lt;true&gt;
<span class="lineNum">     199 </span>                :     {
<span class="lineNum">     200 </span>                :       template&lt;typename _ForwardIterator, typename _Size, typename _Tp&gt;
<span class="lineNum">     201 </span>                :         static void
<span class="lineNum">     202 </span><span class="lineCov">              3 :         uninitialized_fill_n(_ForwardIterator __first, _Size __n,</span>
<span class="lineNum">     203 </span>                :                              const _Tp&amp; __x)
<span class="lineNum">     204 </span><span class="lineCov">              3 :         { std::fill_n(__first, __n, __x); }</span>
<span class="lineNum">     205 </span>                :     };
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span>                :   /**
<span class="lineNum">     208 </span>                :    *  @brief Copies the value x into the range [first,first+n).
<span class="lineNum">     209 </span>                :    *  @param  first  An input iterator.
<span class="lineNum">     210 </span>                :    *  @param  n      The number of copies to make.
<span class="lineNum">     211 </span>                :    *  @param  x      The source value.
<span class="lineNum">     212 </span>                :    *  @return   Nothing.
<span class="lineNum">     213 </span>                :    *
<span class="lineNum">     214 </span>                :    *  Like fill_n(), but does not require an initialized output range.
<span class="lineNum">     215 </span>                :   */
<span class="lineNum">     216 </span>                :   template&lt;typename _ForwardIterator, typename _Size, typename _Tp&gt;
<span class="lineNum">     217 </span>                :     inline void
<span class="lineNum">     218 </span><span class="lineCov">              3 :     uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp&amp; __x)</span>
<span class="lineNum">     219 </span>                :     {
<span class="lineNum">     220 </span>                :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::value_type
<span class="lineNum">     221 </span>                :         _ValueType;
<span class="lineNum">     222 </span>                : 
<span class="lineNum">     223 </span><span class="lineCov">              3 :       std::__uninitialized_fill_n&lt;__is_pod(_ValueType)&gt;::</span>
<span class="lineNum">     224 </span>                :         uninitialized_fill_n(__first, __n, __x);
<span class="lineNum">     225 </span><span class="lineCov">              3 :     }</span>
<span class="lineNum">     226 </span>                : 
<span class="lineNum">     227 </span>                :   // Extensions: versions of uninitialized_copy, uninitialized_fill,
<span class="lineNum">     228 </span>                :   //  and uninitialized_fill_n that take an allocator parameter.
<span class="lineNum">     229 </span>                :   //  We dispatch back to the standard versions when we're given the
<span class="lineNum">     230 </span>                :   //  default allocator.  For nondefault allocators we do not use 
<span class="lineNum">     231 </span>                :   //  any of the POD optimizations.
<span class="lineNum">     232 </span>                : 
<span class="lineNum">     233 </span>                :   template&lt;typename _InputIterator, typename _ForwardIterator,
<span class="lineNum">     234 </span>                :            typename _Allocator&gt;
<span class="lineNum">     235 </span>                :     _ForwardIterator
<span class="lineNum">     236 </span>                :     __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
<span class="lineNum">     237 </span>                :                            _ForwardIterator __result, _Allocator&amp; __alloc)
<span class="lineNum">     238 </span>                :     {
<span class="lineNum">     239 </span>                :       _ForwardIterator __cur = __result;
<span class="lineNum">     240 </span>                :       __try
<span class="lineNum">     241 </span>                :         {
<span class="lineNum">     242 </span>                :           for (; __first != __last; ++__first, ++__cur)
<span class="lineNum">     243 </span>                :             __alloc.construct(&amp;*__cur, *__first);
<span class="lineNum">     244 </span>                :           return __cur;
<span class="lineNum">     245 </span>                :         }
<span class="lineNum">     246 </span>                :       __catch(...)
<span class="lineNum">     247 </span>                :         {
<span class="lineNum">     248 </span>                :           std::_Destroy(__result, __cur, __alloc);
<span class="lineNum">     249 </span>                :           __throw_exception_again;
<span class="lineNum">     250 </span>                :         }
<span class="lineNum">     251 </span>                :     }
<span class="lineNum">     252 </span>                : 
<span class="lineNum">     253 </span>                :   template&lt;typename _InputIterator, typename _ForwardIterator, typename _Tp&gt;
<span class="lineNum">     254 </span>                :     inline _ForwardIterator
<span class="lineNum">     255 </span><span class="lineCov">            233 :     __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,</span>
<span class="lineNum">     256 </span>                :                            _ForwardIterator __result, allocator&lt;_Tp&gt;&amp;)
<span class="lineNum">     257 </span><span class="lineCov">            233 :     { return std::uninitialized_copy(__first, __last, __result); }</span>
<span class="lineNum">     258 </span>                : 
<span class="lineNum">     259 </span>                :   template&lt;typename _InputIterator, typename _ForwardIterator,
<span class="lineNum">     260 </span>                :            typename _Allocator&gt;
<span class="lineNum">     261 </span>                :     inline _ForwardIterator
<span class="lineNum">     262 </span><span class="lineCov">            182 :     __uninitialized_move_a(_InputIterator __first, _InputIterator __last,</span>
<span class="lineNum">     263 </span>                :                            _ForwardIterator __result, _Allocator&amp; __alloc)
<span class="lineNum">     264 </span>                :     {
<span class="lineNum">     265 </span>                :       return std::__uninitialized_copy_a(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
<span class="lineNum">     266 </span>                :                                          _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
<span class="lineNum">     267 </span><span class="lineCov">            182 :                                          __result, __alloc);</span>
<span class="lineNum">     268 </span>                :     }
<span class="lineNum">     269 </span>                : 
<span class="lineNum">     270 </span>                :   template&lt;typename _ForwardIterator, typename _Tp, typename _Allocator&gt;
<span class="lineNum">     271 </span>                :     void
<span class="lineNum">     272 </span>                :     __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">     273 </span>                :                            const _Tp&amp; __x, _Allocator&amp; __alloc)
<span class="lineNum">     274 </span>                :     {
<span class="lineNum">     275 </span>                :       _ForwardIterator __cur = __first;
<span class="lineNum">     276 </span>                :       __try
<span class="lineNum">     277 </span>                :         {
<span class="lineNum">     278 </span>                :           for (; __cur != __last; ++__cur)
<span class="lineNum">     279 </span>                :             __alloc.construct(&amp;*__cur, __x);
<span class="lineNum">     280 </span>                :         }
<span class="lineNum">     281 </span>                :       __catch(...)
<span class="lineNum">     282 </span>                :         {
<span class="lineNum">     283 </span>                :           std::_Destroy(__first, __cur, __alloc);
<span class="lineNum">     284 </span>                :           __throw_exception_again;
<span class="lineNum">     285 </span>                :         }
<span class="lineNum">     286 </span>                :     }
<span class="lineNum">     287 </span>                : 
<span class="lineNum">     288 </span>                :   template&lt;typename _ForwardIterator, typename _Tp, typename _Tp2&gt;
<span class="lineNum">     289 </span>                :     inline void
<span class="lineNum">     290 </span>                :     __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">     291 </span>                :                            const _Tp&amp; __x, allocator&lt;_Tp2&gt;&amp;)
<span class="lineNum">     292 </span>                :     { std::uninitialized_fill(__first, __last, __x); }
<span class="lineNum">     293 </span>                : 
<span class="lineNum">     294 </span>                :   template&lt;typename _ForwardIterator, typename _Size, typename _Tp,
<span class="lineNum">     295 </span>                :            typename _Allocator&gt;
<span class="lineNum">     296 </span>                :     void
<span class="lineNum">     297 </span>                :     __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n, 
<span class="lineNum">     298 </span>                :                              const _Tp&amp; __x, _Allocator&amp; __alloc)
<span class="lineNum">     299 </span>                :     {
<span class="lineNum">     300 </span>                :       _ForwardIterator __cur = __first;
<span class="lineNum">     301 </span>                :       __try
<span class="lineNum">     302 </span>                :         {
<span class="lineNum">     303 </span>                :           for (; __n &gt; 0; --__n, ++__cur)
<span class="lineNum">     304 </span>                :             __alloc.construct(&amp;*__cur, __x);
<span class="lineNum">     305 </span>                :         }
<span class="lineNum">     306 </span>                :       __catch(...)
<span class="lineNum">     307 </span>                :         {
<span class="lineNum">     308 </span>                :           std::_Destroy(__first, __cur, __alloc);
<span class="lineNum">     309 </span>                :           __throw_exception_again;
<span class="lineNum">     310 </span>                :         }
<span class="lineNum">     311 </span>                :     }
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span>                :   template&lt;typename _ForwardIterator, typename _Size, typename _Tp,
<span class="lineNum">     314 </span>                :            typename _Tp2&gt;
<span class="lineNum">     315 </span>                :     inline void
<span class="lineNum">     316 </span><span class="lineCov">              3 :     __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n, </span>
<span class="lineNum">     317 </span>                :                              const _Tp&amp; __x, allocator&lt;_Tp2&gt;&amp;)
<span class="lineNum">     318 </span><span class="lineCov">              3 :     { std::uninitialized_fill_n(__first, __n, __x); }</span>
<span class="lineNum">     319 </span>                : 
<span class="lineNum">     320 </span>                : 
<span class="lineNum">     321 </span>                :   // Extensions: __uninitialized_copy_move, __uninitialized_move_copy,
<span class="lineNum">     322 </span>                :   // __uninitialized_fill_move, __uninitialized_move_fill.
<span class="lineNum">     323 </span>                :   // All of these algorithms take a user-supplied allocator, which is used
<span class="lineNum">     324 </span>                :   // for construction and destruction.
<span class="lineNum">     325 </span>                : 
<span class="lineNum">     326 </span>                :   // __uninitialized_copy_move
<span class="lineNum">     327 </span>                :   // Copies [first1, last1) into [result, result + (last1 - first1)), and
<span class="lineNum">     328 </span>                :   //  move [first2, last2) into
<span class="lineNum">     329 </span>                :   //  [result, result + (last1 - first1) + (last2 - first2)).
<span class="lineNum">     330 </span>                :   template&lt;typename _InputIterator1, typename _InputIterator2,
<span class="lineNum">     331 </span>                :            typename _ForwardIterator, typename _Allocator&gt;
<span class="lineNum">     332 </span>                :     inline _ForwardIterator
<span class="lineNum">     333 </span>                :     __uninitialized_copy_move(_InputIterator1 __first1,
<span class="lineNum">     334 </span>                :                               _InputIterator1 __last1,
<span class="lineNum">     335 </span>                :                               _InputIterator2 __first2,
<span class="lineNum">     336 </span>                :                               _InputIterator2 __last2,
<span class="lineNum">     337 </span>                :                               _ForwardIterator __result,
<span class="lineNum">     338 </span>                :                               _Allocator&amp; __alloc)
<span class="lineNum">     339 </span>                :     {
<span class="lineNum">     340 </span>                :       _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
<span class="lineNum">     341 </span>                :                                                            __result,
<span class="lineNum">     342 </span>                :                                                            __alloc);
<span class="lineNum">     343 </span>                :       __try
<span class="lineNum">     344 </span>                :         {
<span class="lineNum">     345 </span>                :           return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
<span class="lineNum">     346 </span>                :         }
<span class="lineNum">     347 </span>                :       __catch(...)
<span class="lineNum">     348 </span>                :         {
<span class="lineNum">     349 </span>                :           std::_Destroy(__result, __mid, __alloc);
<span class="lineNum">     350 </span>                :           __throw_exception_again;
<span class="lineNum">     351 </span>                :         }
<span class="lineNum">     352 </span>                :     }
<span class="lineNum">     353 </span>                : 
<span class="lineNum">     354 </span>                :   // __uninitialized_move_copy
<span class="lineNum">     355 </span>                :   // Moves [first1, last1) into [result, result + (last1 - first1)), and
<span class="lineNum">     356 </span>                :   //  copies [first2, last2) into
<span class="lineNum">     357 </span>                :   //  [result, result + (last1 - first1) + (last2 - first2)).
<span class="lineNum">     358 </span>                :   template&lt;typename _InputIterator1, typename _InputIterator2,
<span class="lineNum">     359 </span>                :            typename _ForwardIterator, typename _Allocator&gt;
<span class="lineNum">     360 </span>                :     inline _ForwardIterator
<span class="lineNum">     361 </span>                :     __uninitialized_move_copy(_InputIterator1 __first1,
<span class="lineNum">     362 </span>                :                               _InputIterator1 __last1,
<span class="lineNum">     363 </span>                :                               _InputIterator2 __first2,
<span class="lineNum">     364 </span>                :                               _InputIterator2 __last2,
<span class="lineNum">     365 </span>                :                               _ForwardIterator __result,
<span class="lineNum">     366 </span>                :                               _Allocator&amp; __alloc)
<span class="lineNum">     367 </span>                :     {
<span class="lineNum">     368 </span>                :       _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
<span class="lineNum">     369 </span>                :                                                            __result,
<span class="lineNum">     370 </span>                :                                                            __alloc);
<span class="lineNum">     371 </span>                :       __try
<span class="lineNum">     372 </span>                :         {
<span class="lineNum">     373 </span>                :           return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
<span class="lineNum">     374 </span>                :         }
<span class="lineNum">     375 </span>                :       __catch(...)
<span class="lineNum">     376 </span>                :         {
<span class="lineNum">     377 </span>                :           std::_Destroy(__result, __mid, __alloc);
<span class="lineNum">     378 </span>                :           __throw_exception_again;
<span class="lineNum">     379 </span>                :         }
<span class="lineNum">     380 </span>                :     }
<span class="lineNum">     381 </span>                :   
<span class="lineNum">     382 </span>                :   // __uninitialized_fill_move
<span class="lineNum">     383 </span>                :   // Fills [result, mid) with x, and moves [first, last) into
<span class="lineNum">     384 </span>                :   //  [mid, mid + (last - first)).
<span class="lineNum">     385 </span>                :   template&lt;typename _ForwardIterator, typename _Tp, typename _InputIterator,
<span class="lineNum">     386 </span>                :            typename _Allocator&gt;
<span class="lineNum">     387 </span>                :     inline _ForwardIterator
<span class="lineNum">     388 </span>                :     __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
<span class="lineNum">     389 </span>                :                               const _Tp&amp; __x, _InputIterator __first,
<span class="lineNum">     390 </span>                :                               _InputIterator __last, _Allocator&amp; __alloc)
<span class="lineNum">     391 </span>                :     {
<span class="lineNum">     392 </span>                :       std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
<span class="lineNum">     393 </span>                :       __try
<span class="lineNum">     394 </span>                :         {
<span class="lineNum">     395 </span>                :           return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
<span class="lineNum">     396 </span>                :         }
<span class="lineNum">     397 </span>                :       __catch(...)
<span class="lineNum">     398 </span>                :         {
<span class="lineNum">     399 </span>                :           std::_Destroy(__result, __mid, __alloc);
<span class="lineNum">     400 </span>                :           __throw_exception_again;
<span class="lineNum">     401 </span>                :         }
<span class="lineNum">     402 </span>                :     }
<span class="lineNum">     403 </span>                : 
<span class="lineNum">     404 </span>                :   // __uninitialized_move_fill
<span class="lineNum">     405 </span>                :   // Moves [first1, last1) into [first2, first2 + (last1 - first1)), and
<span class="lineNum">     406 </span>                :   //  fills [first2 + (last1 - first1), last2) with x.
<span class="lineNum">     407 </span>                :   template&lt;typename _InputIterator, typename _ForwardIterator, typename _Tp,
<span class="lineNum">     408 </span>                :            typename _Allocator&gt;
<span class="lineNum">     409 </span>                :     inline void
<span class="lineNum">     410 </span>                :     __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
<span class="lineNum">     411 </span>                :                               _ForwardIterator __first2,
<span class="lineNum">     412 </span>                :                               _ForwardIterator __last2, const _Tp&amp; __x,
<span class="lineNum">     413 </span>                :                               _Allocator&amp; __alloc)
<span class="lineNum">     414 </span>                :     {
<span class="lineNum">     415 </span>                :       _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
<span class="lineNum">     416 </span>                :                                                             __first2,
<span class="lineNum">     417 </span>                :                                                             __alloc);
<span class="lineNum">     418 </span>                :       __try
<span class="lineNum">     419 </span>                :         {
<span class="lineNum">     420 </span>                :           std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
<span class="lineNum">     421 </span>                :         }
<span class="lineNum">     422 </span>                :       __catch(...)
<span class="lineNum">     423 </span>                :         {
<span class="lineNum">     424 </span>                :           std::_Destroy(__first2, __mid2, __alloc);
<span class="lineNum">     425 </span>                :           __throw_exception_again;
<span class="lineNum">     426 </span>                :         }
<span class="lineNum">     427 </span>                :     }
<span class="lineNum">     428 </span>                : 
<span class="lineNum">     429 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     430 </span>                :   template&lt;typename _InputIterator, typename _Size,
<span class="lineNum">     431 </span>                :            typename _ForwardIterator&gt;
<span class="lineNum">     432 </span>                :     _ForwardIterator
<span class="lineNum">     433 </span>                :     __uninitialized_copy_n(_InputIterator __first, _Size __n,
<span class="lineNum">     434 </span>                :                            _ForwardIterator __result, input_iterator_tag)
<span class="lineNum">     435 </span>                :     {
<span class="lineNum">     436 </span>                :       _ForwardIterator __cur = __result;
<span class="lineNum">     437 </span>                :       __try
<span class="lineNum">     438 </span>                :         {
<span class="lineNum">     439 </span>                :           for (; __n &gt; 0; --__n, ++__first, ++__cur)
<span class="lineNum">     440 </span>                :             ::new(static_cast&lt;void*&gt;(&amp;*__cur)) typename
<span class="lineNum">     441 </span>                :                 iterator_traits&lt;_ForwardIterator&gt;::value_type(*__first);
<span class="lineNum">     442 </span>                :           return __cur;
<span class="lineNum">     443 </span>                :         }
<span class="lineNum">     444 </span>                :       __catch(...)
<span class="lineNum">     445 </span>                :         {
<span class="lineNum">     446 </span>                :           std::_Destroy(__result, __cur);
<span class="lineNum">     447 </span>                :           __throw_exception_again;
<span class="lineNum">     448 </span>                :         }
<span class="lineNum">     449 </span>                :     }
<span class="lineNum">     450 </span>                : 
<span class="lineNum">     451 </span>                :   template&lt;typename _RandomAccessIterator, typename _Size,
<span class="lineNum">     452 </span>                :            typename _ForwardIterator&gt;
<span class="lineNum">     453 </span>                :     inline _ForwardIterator
<span class="lineNum">     454 </span>                :     __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n,
<span class="lineNum">     455 </span>                :                            _ForwardIterator __result,
<span class="lineNum">     456 </span>                :                            random_access_iterator_tag)
<span class="lineNum">     457 </span>                :     { return std::uninitialized_copy(__first, __first + __n, __result); }
<span class="lineNum">     458 </span>                : 
<span class="lineNum">     459 </span>                :   /**
<span class="lineNum">     460 </span>                :    *  @brief Copies the range [first,first+n) into result.
<span class="lineNum">     461 </span>                :    *  @param  first  An input iterator.
<span class="lineNum">     462 </span>                :    *  @param  n      The number of elements to copy.
<span class="lineNum">     463 </span>                :    *  @param  result An output iterator.
<span class="lineNum">     464 </span>                :    *  @return  result + n
<span class="lineNum">     465 </span>                :    *
<span class="lineNum">     466 </span>                :    *  Like copy_n(), but does not require an initialized output range.
<span class="lineNum">     467 </span>                :   */
<span class="lineNum">     468 </span>                :   template&lt;typename _InputIterator, typename _Size, typename _ForwardIterator&gt;
<span class="lineNum">     469 </span>                :     inline _ForwardIterator
<span class="lineNum">     470 </span>                :     uninitialized_copy_n(_InputIterator __first, _Size __n,
<span class="lineNum">     471 </span>                :                          _ForwardIterator __result)
<span class="lineNum">     472 </span>                :     { return std::__uninitialized_copy_n(__first, __n, __result,
<span class="lineNum">     473 </span>                :                                          std::__iterator_category(__first)); }
<span class="lineNum">     474 </span>                : #endif
<span class="lineNum">     475 </span>                : 
<span class="lineNum">     476 </span>                : _GLIBCXX_END_NAMESPACE
<span class="lineNum">     477 </span>                : 
<span class="lineNum">     478 </span>                : #endif /* _STL_UNINITIALIZED_H */
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
